package pub.tbc.mybatis.mappers;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import pub.tbc.mybatis.domain.User;

import java.util.List;
import java.util.Map;

/**
 * @author tbc on 2017/5/9 13:14:48.
 */
@Mapper
public interface UserMapper {

    @Insert("insert into users(name, age)values(#{name}, #{age})")
    int addUser(User user);

    @Select("select * from users where name = #{name}")
    User findUser(String name);

    @Select("select * from users")
    List<User> users();

    @Select("select * from users")
    List<User> pageUsers(Map<String, Object> param);


}
